Skip to main content
Version: Next

getRuntime

This method is for calculating the execution time of a normal function (sync). This method calculates the execution time of the function with millisecond accuracy.

Params

getRuntime(inputFunction);
  • inputFunction → This input is a function. The function whose execution time will be calculated

Returns

0.094
  • Number → The duration of the function execution is returned in milliseconds

Usage

const testFunction = ()=>{
let a = 2345345436;
let b = 45364536457;
let c = a * b;
c = c**2
}

getRuntime(testFunction) //0.009